package cn.bdqn.sptparent.web.mq;

import com.alibaba.fastjson.JSONObject;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class MQSender {

    @Resource
    RabbitTemplate rabbitTemplate;

    public void sendToken(Object message){
        rabbitTemplate.convertAndSend(RabbitConfig.SAVE_TOKEN,JSONObject.toJSONString(message));
    }

    public void
    sendHTML(Object message){
        rabbitTemplate.convertAndSend(RabbitConfig.SAVE_HTML,JSONObject.toJSONString(message));
    }

}
